package com.smmisia.shop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.smmisia.shop.enums.*;
import lombok.Builder;
import lombok.Data;

/**
 * 
 * @TableName ticket
 */
@TableName(value ="ticket")
@Data
@Builder
public class Ticket implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 票名
     */
    private String ticketName;

    /**
     * 原始价格
     */
    private BigDecimal price;

    /**
     * 售卖价格
     */
    private BigDecimal salePrice;

    /**
     * 0原价,1特价
     */
    private SpecialEnum specialStatus;

    /**
     * 景区id
     */
    private Integer scenicSpotId;

    /**
     * 景点id
     */
    private Integer attractionId;

    /**
     * 景区名
     */
    private String scenicSpotName;

    /**
     * 景点名
     */
    private String attractionName;

    /**
     * 图片
     */
    private String images;

    /**
     * 0景区票，1景点票
     */
    private TicketTypeEnum type;

    /**
     * 0闪入园，1延迟入园
     */
    private EnterStatusEnum enterStatus;

    /**
     * 延迟入园时间(小时)
     */
    private String delayTime;

    /**
     * 0随时可退,1审核
     */
    private SubscribeEnum unsubscribeStatus;

    /**
     * 可订时间，在某某时间之前可订当天
     */
    private LocalDateTime scheduleTime;

    /**
     * 0过期自动退款,1过期自动失效不退款
     */
    private ExpiredEnum expiredStatus;

    /**
     * 0无需换票,1需要换票
     */
    private ExchangeEnum exchangeStatus;

    /**
     * 0单票,1联票
     */
    private ComboEnum comboStatus;

    /**
     * 联票id集合
     */
    private String comboAttractionId;

    /**
     * 进入时间
     */
    private LocalDateTime enterTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * 入园地址
     */
    private String enterAddress;

    /**
     * 门票数量
     */
    private Integer count;

    /**
     * 剩余数量
     */
    private Integer remainCount;

    /**
     * 已售数量
     */
    private Integer saleCount;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 更新人
     */
    private String updateUser;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Ticket other = (Ticket) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTicketName() == null ? other.getTicketName() == null : this.getTicketName().equals(other.getTicketName()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getSalePrice() == null ? other.getSalePrice() == null : this.getSalePrice().equals(other.getSalePrice()))
            && (this.getSpecialStatus() == null ? other.getSpecialStatus() == null : this.getSpecialStatus().equals(other.getSpecialStatus()))
            && (this.getScenicSpotId() == null ? other.getScenicSpotId() == null : this.getScenicSpotId().equals(other.getScenicSpotId()))
            && (this.getAttractionId() == null ? other.getAttractionId() == null : this.getAttractionId().equals(other.getAttractionId()))
            && (this.getScenicSpotName() == null ? other.getScenicSpotName() == null : this.getScenicSpotName().equals(other.getScenicSpotName()))
            && (this.getAttractionName() == null ? other.getAttractionName() == null : this.getAttractionName().equals(other.getAttractionName()))
            && (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getEnterStatus() == null ? other.getEnterStatus() == null : this.getEnterStatus().equals(other.getEnterStatus()))
            && (this.getDelayTime() == null ? other.getDelayTime() == null : this.getDelayTime().equals(other.getDelayTime()))
            && (this.getUnsubscribeStatus() == null ? other.getUnsubscribeStatus() == null : this.getUnsubscribeStatus().equals(other.getUnsubscribeStatus()))
            && (this.getScheduleTime() == null ? other.getScheduleTime() == null : this.getScheduleTime().equals(other.getScheduleTime()))
            && (this.getExpiredStatus() == null ? other.getExpiredStatus() == null : this.getExpiredStatus().equals(other.getExpiredStatus()))
            && (this.getExchangeStatus() == null ? other.getExchangeStatus() == null : this.getExchangeStatus().equals(other.getExchangeStatus()))
            && (this.getComboStatus() == null ? other.getComboStatus() == null : this.getComboStatus().equals(other.getComboStatus()))
            && (this.getComboAttractionId() == null ? other.getComboAttractionId() == null : this.getComboAttractionId().equals(other.getComboAttractionId()))
            && (this.getEnterTime() == null ? other.getEnterTime() == null : this.getEnterTime().equals(other.getEnterTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getEnterAddress() == null ? other.getEnterAddress() == null : this.getEnterAddress().equals(other.getEnterAddress()))
            && (this.getCount() == null ? other.getCount() == null : this.getCount().equals(other.getCount()))
            && (this.getRemainCount() == null ? other.getRemainCount() == null : this.getRemainCount().equals(other.getRemainCount()))
            && (this.getSaleCount() == null ? other.getSaleCount() == null : this.getSaleCount().equals(other.getSaleCount()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTicketName() == null) ? 0 : getTicketName().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getSalePrice() == null) ? 0 : getSalePrice().hashCode());
        result = prime * result + ((getSpecialStatus() == null) ? 0 : getSpecialStatus().hashCode());
        result = prime * result + ((getScenicSpotId() == null) ? 0 : getScenicSpotId().hashCode());
        result = prime * result + ((getAttractionId() == null) ? 0 : getAttractionId().hashCode());
        result = prime * result + ((getScenicSpotName() == null) ? 0 : getScenicSpotName().hashCode());
        result = prime * result + ((getAttractionName() == null) ? 0 : getAttractionName().hashCode());
        result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getEnterStatus() == null) ? 0 : getEnterStatus().hashCode());
        result = prime * result + ((getDelayTime() == null) ? 0 : getDelayTime().hashCode());
        result = prime * result + ((getUnsubscribeStatus() == null) ? 0 : getUnsubscribeStatus().hashCode());
        result = prime * result + ((getScheduleTime() == null) ? 0 : getScheduleTime().hashCode());
        result = prime * result + ((getExpiredStatus() == null) ? 0 : getExpiredStatus().hashCode());
        result = prime * result + ((getExchangeStatus() == null) ? 0 : getExchangeStatus().hashCode());
        result = prime * result + ((getComboStatus() == null) ? 0 : getComboStatus().hashCode());
        result = prime * result + ((getComboAttractionId() == null) ? 0 : getComboAttractionId().hashCode());
        result = prime * result + ((getEnterTime() == null) ? 0 : getEnterTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getEnterAddress() == null) ? 0 : getEnterAddress().hashCode());
        result = prime * result + ((getCount() == null) ? 0 : getCount().hashCode());
        result = prime * result + ((getRemainCount() == null) ? 0 : getRemainCount().hashCode());
        result = prime * result + ((getSaleCount() == null) ? 0 : getSaleCount().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", ticketName=").append(ticketName);
        sb.append(", price=").append(price);
        sb.append(", salePrice=").append(salePrice);
        sb.append(", specialStatus=").append(specialStatus);
        sb.append(", scenicSpotId=").append(scenicSpotId);
        sb.append(", attractionId=").append(attractionId);
        sb.append(", scenicSpotName=").append(scenicSpotName);
        sb.append(", attractionName=").append(attractionName);
        sb.append(", images=").append(images);
        sb.append(", type=").append(type);
        sb.append(", enterStatus=").append(enterStatus);
        sb.append(", delayTime=").append(delayTime);
        sb.append(", unsubscribeStatus=").append(unsubscribeStatus);
        sb.append(", scheduleTime=").append(scheduleTime);
        sb.append(", expiredStatus=").append(expiredStatus);
        sb.append(", exchangeStatus=").append(exchangeStatus);
        sb.append(", comboStatus=").append(comboStatus);
        sb.append(", comboAttractionId=").append(comboAttractionId);
        sb.append(", enterTime=").append(enterTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", enterAddress=").append(enterAddress);
        sb.append(", count=").append(count);
        sb.append(", remainCount=").append(remainCount);
        sb.append(", saleCount=").append(saleCount);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createUser=").append(createUser);
        sb.append(", updateUser=").append(updateUser);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}